﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace TronLeapRacing
{
    class Barrier : GameObject
    {
        public string barrierType;

        public Barrier()
            : base()
        {
            barrierType = null;
        }

        public void LoadContent(ContentManager Content, string name)
        {
            model = Content.Load<Model>(name);
            barrierType = name;
            position = Vector3.Down;
        }

        public void Draw(Matrix view, Matrix projection)
        {
                foreach (ModelMesh mesh in model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        effect.EnableDefaultLighting();
                        effect.PreferPerPixelLighting = true;

                        effect.World = Matrix.CreateTranslation(position);
                        effect.View = view;
                        effect.Projection = projection;
                    }
                    mesh.Draw();
                }
        }
    }
}
